/**
 * Created by David on 2019/1/4.
 */
const menuConfig = {
    title: 'Order111',
    // 'body' key 缺失
    buttonText: 'Send',
    cancellable: true
};

function createMenu(config1) {
    config = Object.assign({
        title: 'Foo',
        body: 'Bar',
        buttonText: 'Baz',
        cancellable: true
    }, config1);

    // config 就变成了: {title: "Order", body: "Bar", buttonText: "Send", cancellable: true}
    // ...
    console.log(config)
}

createMenu(menuConfig);


